////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file   CollabRCBotUnitTests\MockConstantTreeNode.h
///
/// @brief  Declares the MockConstantTreeNode class
////////////////////////////////////////////////////////////////////////////////////////////////////

#pragma once
#include "../CollabRCBot/ComputationalTreeNode.h"
#include "../CollabRCBot/ComputationalTreeNodeVisitor.h"

////////////////////////////////////////////////////////////////////////////////////////////////////
/// @class  MockConstantTreeNode
///
/// @brief  Implementation of a CollabRC::Bot::AI::ComputationalTreeNode which
/// allows for a constant to be represented. 
///
/// This is used as a mock object for testing
/// other CollabRC::Bot::AI::ComputationalTreeNodes. The mutation operation
/// is invalid on this class. The branch depth is always 1, and attempting to
/// get a random branch will always return itself.
///
/// @author Matthew P. Del Buono
/// @date   12/24/2009
////////////////////////////////////////////////////////////////////////////////////////////////////

class MockConstantTreeNode :
    public CollabRC::Bot::AI::ComputationalTreeNode
{
private:
    float m_constant;
public:
    MockConstantTreeNode(float constant);
    MockConstantTreeNode(const MockConstantTreeNode& copy);
    virtual ~MockConstantTreeNode();
    virtual ComputationalTreeNode* Clone() const;
    virtual ComputationalTreeNode* Mutate(unsigned int depth) const;
    virtual const ComputationalTreeNode& GetRandomBranch(unsigned int depth) const;
    virtual unsigned int GetBranchDepth() const;
    virtual float Compute() const;
    virtual void Accept(CollabRC::Bot::AI::ComputationalTreeNodeVisitor& visitor);

    inline float GetValue() const {return m_constant; };
    inline void SetValue(float value) { m_constant = value; };

};
